home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xml / URIStringScheme.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  3.0 KB  |  99 lines

  1. package com.extensibility.xml;
  2.  
  3. import com.extensibility.plugin.PluginRegistry;
  4. import com.extensibility.plugin.api.URIScheme;
  5. import com.extensibility.plugin.api.URISchemeAdapter;
  6. import java.io.ByteArrayInputStream;
  7. import java.io.IOException;
  8. import java.io.InputStream;
  9. import java.io.OutputStream;
  10. import java.io.Reader;
  11. import java.io.StringReader;
  12. import java.io.Writer;
  13.  
  14. public class URIStringScheme extends URISchemeAdapter {
  15.    private String data;
  16.  
  17.    public static void registerPlugin(PluginRegistry var0) {
  18.       var0.registerPlugin("URIScheme10", Class.forName("com.extensibility.xml.URIStringScheme"), "URIStringScheme", 65537);
  19.    }
  20.  
  21.    public URIStringScheme() {
  22.       this.data = null;
  23.    }
  24.  
  25.    public URIStringScheme(String var1) {
  26.       this.data = var1;
  27.    }
  28.  
  29.    public void registerSchemes(URIScheme.Manager var1) {
  30.       var1.registerScheme(":xa-string", Class.forName("java.lang.String"), this);
  31.    }
  32.  
  33.    public URIScheme construct(String var1, String var2) {
  34.       return null;
  35.    }
  36.  
  37.    public URIScheme construct(Object var1) {
  38.       return new URIStringScheme((String)var1);
  39.    }
  40.  
  41.    public URIScheme construct(String var1) {
  42.       return null;
  43.    }
  44.  
  45.    public String computeRelative(URIScheme var1) {
  46.       return "";
  47.    }
  48.  
  49.    public String getScheme() {
  50.       return ":xa-string";
  51.    }
  52.  
  53.    public long getLength() {
  54.       return (long)this.data.length();
  55.    }
  56.  
  57.    public InputStream createInputStream() throws IOException {
  58.       return new ByteArrayInputStream(this.data.getBytes());
  59.    }
  60.  
  61.    public Reader createReader() throws IOException {
  62.       return new StringReader(this.data);
  63.    }
  64.  
  65.    public Writer createWriter() throws IOException {
  66.       throw new IllegalArgumentException();
  67.    }
  68.  
  69.    public OutputStream createOutputStream() throws IOException {
  70.       throw new IllegalArgumentException();
  71.    }
  72.  
  73.    public boolean exists() {
  74.       return this.data != null;
  75.    }
  76.  
  77.    public boolean hasPersistence() {
  78.       return false;
  79.    }
  80.  
  81.    public boolean equals(URIScheme var1) {
  82.       URIStringScheme var2 = (URIStringScheme)var1;
  83.       return this.data.equals(var2.data);
  84.    }
  85.  
  86.    public int compareTo(URIScheme var1) {
  87.       URIStringScheme var2 = (URIStringScheme)var1;
  88.       return this.data.compareTo(var2.data);
  89.    }
  90.  
  91.    public String getShortName() {
  92.       return "";
  93.    }
  94.  
  95.    public String getFullPath() {
  96.       return "";
  97.    }
  98. }
  99.